'use strict';

angular.module('inspinia', [
    'ngAnimate',
    'ngCookies',
    'ngTouch',
    'ngSanitize',
    'ngResource',
    'ui.router',
    'ui.bootstrap',
    "oc.lazyLoad",
    'rzModule',
    "ngMessages",
    "pascalprecht.translate",
    "ngDraggable"
  ])
  .config(function ($stateProvider, $urlRouterProvider, $logProvider,$httpProvider, $ocLazyLoadProvider) {
    $logProvider.debugEnabled(true);
    $stateProvider


      .state('login', {
        cache: false,
        url: "/login",
        templateUrl: "app/user/login.html",
        data: {pageTitle: 'Login', specialClass: 'gray-bg'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css']
              },
              {
                insertBefore: '#loadBefore',
                name: 'toaster',
                files: ['plugins/toastr/toastr.min.css', 'plugins/toastr/toastr.min.js']
              }
            ]);
          }
        }
      })

      .state('forgot_password', {
        cache: false,
        url: "/forgot_password",
        templateUrl: "app/user/forgotPassword.html",
        controller: "registerforgetPasswordCtrl",
        data: {pageTitle: 'forgot_password view', specialClass: 'gray-bg'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                insertBefore: '#loadBefore',
                name: 'toaster',
                files: ['plugins/toastr/toastr.min.css', 'plugins/toastr/toastr.min.js']
              }
            ]);
          }
        }
      })

      .state('userRegister', {
        cache: false,
        url: "/userRegister",
        templateUrl: "app/user/user_register.html",
        controller: "userRegisterCtrl",
        data: {pageTitle: 'userRegister view', specialClass: 'gray-bg'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                insertBefore: '#loadBefore',
                name: 'toaster',
                files: ['plugins/toastr/toastr.min.css', 'plugins/toastr/toastr.min.js']
              },
              {
                files: ['plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css']
              },
            ]);
          }
        }
      })

      .state('user.register', {
        url: "/register",
        templateUrl: "app/user/register.html",
        controller: "registerCtrl",
        data: {pageTitle: 'Example view'},

        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/bootstrap/ui-bootstrap-tpls-0.12.0.min.js', 'plugins/angular-messages/angular-messages.min.js']
              },
              {
                insertBefore: '#loadBefore',
                name: 'localytics.directives',
                files: ['plugins/chosen/chosen.css', 'plugins/chosen/chosen.jquery.js', 'plugins/chosen/chosen.js']
              },
              {
                files: ['plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css']
              },
              {
                insertBefore: '#loadBefore',
                name: 'toaster',
                files: ['plugins/toastr/toastr.min.css', 'plugins/toastr/toastr.min.js']
              },
              {
                name: 'datePicker',
                files: ['plugins/datapicker/angular-datapicker.css', 'plugins/datapicker/angular-datepicker.js']
              },
              {
                serie: true,
                files: ['plugins/moment/moment.min.js']
              },
            ]);
          }
        }
      })

      .state('user.hospitalizedCard', {
        url: "/hospitalizedCard",
        templateUrl: "app/user/hospitalizedCard.html",
        controller: "hospitalCardCtrl",
        data: {pageTitle: 'hospitalizedCard view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['/app/validate/validate.css']
              },
              {
                insertBefore: '#loadBefore',
                name: "AngularPrint",
                files: ['bower_components/angularPrint/angularPrint.js', 'bower_components/angularPrint/angularPrint.css']
              }
            ]);
          }
        }
      })


      .state('index', {
        abstract: true,
        url: "/index",
        templateUrl: "components/common/content.html"
      })

      .state('index.dashboard_director', {
        url: "/dashboard",
        templateUrl: "app/dashboard/director.html",
        data: {pageTitle: 'Example view'},

        controllerAs: "chart",
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                serie: true,
                name: 'angular-flot',
                files: ['plugins/flot/jquery.flot.js', 'plugins/flot/jquery.flot.time.js', 'plugins/flot/jquery.flot.tooltip.min.js', 'plugins/flot/jquery.flot.spline.js', 'plugins/flot/jquery.flot.resize.js', 'plugins/flot/jquery.flot.pie.js', 'plugins/flot/curvedLines.js', 'plugins/flot/angular-flot.js',]
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-2.0.2.min.js', 'plugins/jvectormap/jquery-jvectormap-2.0.2.css']
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-world-mill-en.js']
              },
              {
                files: ['plugins/chartJs/Chart.min.js']
              },
              {
                name: 'angles',
                files: ['plugins/chartJs/angles.js']
              },
              {
                name: 'ui.checkbox',
                files: ['plugins/bootstrap/angular-bootstrap-checkbox.js']
              },
              {
                files: ['plugins/echarts/echarts.min.js']
              }

            ]);
          }
        }
      })

      .state('index.dashboard_physicist', {
        url: "/dashboard_physicist",
        // V1
        // templateUrl: "app/dashboard/physicist.html",
        templateUrl: "app/dashboard/physicist.html",
        data: {pageTitle: 'Example view'},
        controller: "physicistCtrl",
        // controllerAs: "chart",
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                serie: true,
                name: 'angular-flot',
                files: ['plugins/flot/jquery.flot.js', 'plugins/flot/jquery.flot.time.js', 'plugins/flot/jquery.flot.tooltip.min.js', 'plugins/flot/jquery.flot.spline.js', 'plugins/flot/jquery.flot.resize.js', 'plugins/flot/jquery.flot.pie.js', 'plugins/flot/curvedLines.js', 'plugins/flot/angular-flot.js',]
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-2.0.2.min.js', 'plugins/jvectormap/jquery-jvectormap-2.0.2.css']
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-world-mill-en.js']
              },
              {
                files: ['plugins/chartJs/Chart.min.js']
              },
              {
                name: 'angles',
                files: ['plugins/chartJs/angles.js']
              },
              {
                name: 'ui.checkbox',
                files: ['plugins/bootstrap/angular-bootstrap-checkbox.js']
              },
              {
                files: ['plugins/echarts/echarts.min.js']
              }

            ]);
          }
        }
      })

      .state('index.dashboard_verify', {
        url: "/dashboard_verify",
        templateUrl: "app/dashboard/verify.html",
        data: {pageTitle: 'verify view'},
        controller: "verifyCtrl",
        // controllerAs: "chart",
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                serie: true,
                name: 'angular-flot',
                files: ['plugins/flot/jquery.flot.js', 'plugins/flot/jquery.flot.time.js', 'plugins/flot/jquery.flot.tooltip.min.js', 'plugins/flot/jquery.flot.spline.js', 'plugins/flot/jquery.flot.resize.js', 'plugins/flot/jquery.flot.pie.js', 'plugins/flot/curvedLines.js', 'plugins/flot/angular-flot.js',]
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-2.0.2.min.js', 'plugins/jvectormap/jquery-jvectormap-2.0.2.css']
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-world-mill-en.js']
              },
              {
                files: ['plugins/chartJs/Chart.min.js']
              },
              {
                name: 'angles',
                files: ['plugins/chartJs/angles.js']
              },
              {
                name: 'ui.checkbox',
                files: ['plugins/bootstrap/angular-bootstrap-checkbox.js']
              },
              {
                files: ['plugins/echarts/echarts.min.js']
              }

            ]);
          }
        }
      })

      .state('index.dashboard_finance', {
        url: "/dashboard_finance",
        templateUrl: "app/dashboard/finance.html",
        data: {pageTitle: 'finance view'},
        controller: "financeCtrl",
        // controllerAs: "chart",
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                serie: true,
                name: 'angular-flot',
                files: ['plugins/flot/jquery.flot.js', 'plugins/flot/jquery.flot.time.js', 'plugins/flot/jquery.flot.tooltip.min.js', 'plugins/flot/jquery.flot.spline.js', 'plugins/flot/jquery.flot.resize.js', 'plugins/flot/jquery.flot.pie.js', 'plugins/flot/curvedLines.js', 'plugins/flot/angular-flot.js',]
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-2.0.2.min.js', 'plugins/jvectormap/jquery-jvectormap-2.0.2.css']
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-world-mill-en.js']
              },
              {
                files: ['plugins/chartJs/Chart.min.js']
              },
              {
                name: 'angles',
                files: ['plugins/chartJs/angles.js']
              },
              {
                name: 'ui.checkbox',
                files: ['plugins/bootstrap/angular-bootstrap-checkbox.js']
              },
              {
                files: ['plugins/echarts/echarts.min.js']
              }

            ]);
          }
        }
      })

      .state('index.dashboard_treatment', {
        url: "/dashboard_treatment",
        templateUrl: "app/dashboard/treatment_dashboard.html",
        data: {pageTitle: 'dashboard_treatment view'},
        controller: "treatment_dbCtrl",
        // controllerAs: "chart",
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                serie: true,
                name: 'angular-flot',
                files: ['plugins/flot/jquery.flot.js', 'plugins/flot/jquery.flot.time.js', 'plugins/flot/jquery.flot.tooltip.min.js', 'plugins/flot/jquery.flot.spline.js', 'plugins/flot/jquery.flot.resize.js', 'plugins/flot/jquery.flot.pie.js', 'plugins/flot/curvedLines.js', 'plugins/flot/angular-flot.js',]
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-2.0.2.min.js', 'plugins/jvectormap/jquery-jvectormap-2.0.2.css']
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-world-mill-en.js']
              },
              {
                files: ['plugins/chartJs/Chart.min.js']
              },
              {
                name: 'angles',
                files: ['plugins/chartJs/angles.js']
              },
              {
                name: 'ui.checkbox',
                files: ['plugins/bootstrap/angular-bootstrap-checkbox.js']
              },
              {
                files: ['plugins/echarts/echarts.min.js']
              }

            ]);
          }
        }
      })

      .state('index.minor', {
        url: "/minor",
        templateUrl: "app/minor/minor.html",
        data: {pageTitle: 'Example view'}
      })


      .state('index.main', {
        url: "/main",
        templateUrl: "app/main/main.html",
        data: {pageTitle: 'Example view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              // {
              //   files: ['plugins/seiyria-bootstrap-slider/bootstrap-slider.css','plugins/seiyria-bootstrap-slider/bootstrap-slider.js']
              // },

              {

                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              },
            ]);
          }
        }
      })

      .state('index.openForm', {
        url: "/FormMessage",
        controller:'openFormCtrl',
        templateUrl: "app/main/openForm.html",
        data: {pageTitle: 'openForm view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                insertBefore: '#loadBefore',
                name: "AngularPrint",
                files: ['bower_components/angularPrint/angularPrint.js', 'bower_components/angularPrint/angularPrint.css']
              },
              {
                files: ['/app/validate/validate.css']
              },
              {
                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              },
              {
                serie: true,
                files: ['plugins/moment/moment.min.js']
              },
            ]);
          }
        }
      })

      .state('index.openForm_new', {
        url: "/openForm_new",
        controller:'openForm_new',
        templateUrl: "app/forms/openForm_new.html",
        data: {pageTitle: 'openForm_new view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                insertBefore: '#loadBefore',
                name: "AngularPrint",
                files: ['bower_components/angularPrint/angularPrint.js', 'bower_components/angularPrint/angularPrint.css']
              },
              {
                files: ['/app/validate/validate.css']
              },
              {
                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              },
              {
                serie: true,
                files: ['plugins/moment/moment.min.js']
              },
              {
                files: ['plugins/jsTree/style.min.css', 'plugins/jsTree/jstree.min.js']
              },
              {
                name: 'ngJsTree',
                files: ['/plugins/jsTree/ngJsTree.min.js']
              }
            ]);
          }
        }
      })


      .state('viewer', {
        abstract: true,
        url: "/viewer",
        templateUrl: "components/common/viewerContent.html"
      })

      .state('viewer.contouring', {
        url: "/contouring",
        templateUrl: "app/Contouring/Contouring.html",
        controller: "ContouringController",
        data: {pageTitle: 'Example view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/jsTree/style.css', 'plugins/jsTree/jstree.js']
              },
              {
                name: 'ngJsTree',
                files: ['plugins/jsTree/ngJsTree.min.js']
              },
              {
                serie: true,
                files: [
                  '../bower_components/jquery/dist/jquery.min.js',
                  'plugins/Viewer/untils/jquery.hotkeys.js',
                  'plugins/Viewer/untils/jquery.browser.js',
                  'plugins/Viewer/untils/humane.js',
                  'plugins/Viewer/untils/jquery.slimscroll.min.js',
                  'plugins/Viewer/untils/jackedup.css'
                ]
              },
              {
                serie: true,
                files: ['plugins/Viewer/untils/cornerstone.js',
                  'plugins/Viewer/untils/cornerstoneMath.min.js',
                  'plugins/Viewer/untils/cornerstoneTools.js',
                  'plugins/Viewer/untils/dicomParser.min.js'
                ]
              },
              {
                serie: true,
                files: ['plugins/Viewer/untils/cornerstoneWebImageLoader.min.js',
                  'plugins/Viewer/untils/cornerstoneWADOImageLoader.min.js'
                ]
              },
              {
                serie: true,
                files: ['plugins/Viewer/lm.core.min.js',
                  'plugins/Viewer/lm.msgShow.js',
                  'plugins/Viewer/lm.Viewer.js',
                  'plugins/Viewer/lm.Viewer.srv.js',
                  'plugins/Viewer/lm.Viewer.ui.js',
                  'plugins/Viewer/lm.msgShow.js',
                  'app/templateJS/freehand.js'
                ]
              },
              {
                files: ['plugins/underscore/underscore-min.js']
              },

              {
                serie: true,
                files: ['plugins/c3/c3.min.css', 'plugins/d3/d3.min.js', 'plugins/c3/c3.min.js']
              },
              {
                serie: true,
                name: 'gridshore.c3js.chart',
                files: ['plugins/c3/c3-angular.min.js']
              },
              {
                files: ['plugins/chartJs/Chart.min.js']
              },
              {
                name: 'angles',
                files: ['plugins/chartJs/angles.js']
              }
            ]);
          }
        }
      })

      .state('viewer.contouring02', {
        url: "/contouring02",
        templateUrl: "app/contouring02/Contouring.html",
        data: {pageTitle: 'Example view'},


        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([

              //阅片需要引入的JS文件

              {
                serie: true,
                name: 'ngJsTree',
                files: [
                  'plugins/jsTree/jstree.min.js',
                  'plugins/jsTree/style.min.css',
                  'plugins/jsTree/ngJsTree.min.js'
                ]
              },
              {
                serie: true,
                files: [
                  '../bower_components/jquery/dist/jquery.min.js',
                  'plugins/Viewer/untils/jquery.hotkeys.js',
                  'plugins/Viewer/untils/jquery.browser.js',
                  'plugins/Viewer/untils/humane.js',
                  'plugins/Viewer/untils/jquery.slimscroll.min.js',
                  'plugins/Viewer/untils/jackedup.css',
                  'plugins/custom-scrollbar/jquery.mCustomScrollbar.min.css',
                  'plugins/custom-scrollbar/jquery.mCustomScrollbar.concat.min.js'
                ]
              },
              {
                serie: true,
                files: [
                  'plugins/Viewer/lm.core.min.js',
                  'app/config/msgManage.js'
                ]
              },
              {
                serie: true,
                files: ['plugins/Viewer/untils/cornerstone.js',
                  'plugins/Viewer/untils/cornerstoneMath.min.js',
                  'plugins/Viewer/untils/cornerstoneTools.js',
                  'plugins/Viewer/untils/dicomParser.min.js'
                ]
              },
              {
                serie: true,
                files: ['plugins/Viewer/untils/cornerstoneWebImageLoader.min.js',
                  'plugins/Viewer/untils/cornerstoneWADOImageLoader.min.js'
                ]
              },
              {
                serie: true,
                files: ['plugins/Viewer/lm.core.min.js',
                  'plugins/Viewer/lm.msgShow.js',
                  'plugins/Viewer/lm.Viewer.js',
                  'plugins/Viewer/lm.Viewer.srv.js',
                  'plugins/Viewer/lm.Viewer.ui.js',
                  'plugins/Viewer/lm.msgShow.js',
                ]
              },

              {
                files: ['plugins/underscore/underscore-min.js']
              },


              {
                serie: true,
                files: ['plugins/c3/c3.min.css', 'plugins/d3/d3.min.js', 'plugins/c3/c3.min.js']
              },
              {
                serie: true,
                name: 'gridshore.c3js.chart',
                files: ['plugins/c3/c3-angular.min.js']
              },
              {
                files: ['plugins/chartJs/Chart.min.js']
              },
              {
                name: 'angles',
                files: ['plugins/chartJs/angles.js']
              },

            ]);
          }
        }
      })

      .state('index.contouringDirector', {
        url: "/contouringDirector",
        templateUrl: "app/contouring02/contouringDirector.html",
        data: {pageTitle: 'Example view'},
        controller: "contouringDirector",
        controllerAs: "chart",
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                serie: true,
                name: 'angular-flot',
                files: ['plugins/flot/jquery.flot.js', 'plugins/flot/jquery.flot.time.js', 'plugins/flot/jquery.flot.tooltip.min.js', 'plugins/flot/jquery.flot.spline.js', 'plugins/flot/jquery.flot.resize.js', 'plugins/flot/jquery.flot.pie.js', 'plugins/flot/curvedLines.js', 'plugins/flot/angular-flot.js',]
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-2.0.2.min.js', 'plugins/jvectormap/jquery-jvectormap-2.0.2.css']
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-world-mill-en.js']
              },
              {
                files: ['plugins/chartJs/Chart.min.js']
              },
              {
                name: 'angles',
                files: ['plugins/chartJs/angles.js']
              },
              {
                name: 'ui.checkbox',
                files: ['plugins/bootstrap/angular-bootstrap-checkbox.js']
              },
              {
                files: ['plugins/echarts/echarts.min.js']
              }

            ]);
          }
        }
      })

      .state('viewer.ebp', {
        url: "/ebp",
        templateUrl: "app/EBP/EBP.html",
        data: {pageTitle: 'Example view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files:['plugins/angularjs-slider/dist/rzslider.css','plugins/angularjs-slider/dist/rzslider.js'],
              },

              {
                files: ['plugins/jquery-ui/jquery-ui.min.js','plugins/jquery-ui/jquery-ui.min.css']
              },
              {
                files: ['plugins/underscore/underscore-min.js']
              },
              {
                files: ['plugins/jsTree/style.min.css', 'plugins/jsTree/jstree.min.js']
              },
              {
                name: 'ngJsTree',
                files: ['plugins/jsTree/ngJsTree.min.js']
              },

              {
                files: ['plugins/echarts/echarts.min.js']
              },
              {
                name: 'angles',
                files: ['plugins/chartJs/angles.js']
              },
              {
                serie: true,
                files: [
                  '../bower_components/jquery/dist/jquery.min.js',
                  'plugins/Viewer/untils/jquery.hotkeys.js',
                  'plugins/Viewer/untils/jquery.browser.js',
                  'plugins/Viewer/untils/humane.js',
                  'plugins/Viewer/untils/jquery.slimscroll.min.js',
                  'plugins/Viewer/untils/jackedup.css',
                  'plugins/custom-scrollbar/jquery.mCustomScrollbar.min.css',
                  'plugins/custom-scrollbar/jquery.mCustomScrollbar.concat.min.js'
                ]
              },
              {
                serie: true,
                files: ['plugins/Viewer/untils/cornerstone.js',
                  'plugins/Viewer/untils/cornerstoneMath.min.js',
                  'plugins/Viewer/untils/cornerstoneTools.js',
                  'plugins/Viewer/untils/dicomParser.min.js'
                ]
              },
              {
                serie: true,
                files: ['plugins/Viewer/untils/cornerstoneWebImageLoader.min.js',
                  'plugins/Viewer/untils/cornerstoneWADOImageLoader.min.js'
                ]
              },
              {
                serie: true,
                files: ['plugins/Viewer/lm.core.min.js',
                  'plugins/Viewer/lm.msgShow.js',
                  'plugins/Viewer/lm.Viewer.js',
                  'plugins/Viewer/lm.Viewer.srv.js',
                  'plugins/Viewer/lm.Viewer.ui.js',
                  'plugins/Viewer/lm.Viewer.colorMap.js',
                  'plugins/Viewer/lm.msgShow.js',
                  'plugins/Viewer/lm.Viewer.RT.DoseGridFrame.js',
                ]
              }
            ]);
          }
        }
      })

      .state('index.EBPlist', {
        url: "/EBPlist",
        templateUrl: "app/EBP/EBPlist.html",
        data: {pageTitle: 'EBPlist'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              },
            ]);
          }
        }
      })

      .state('viewer.imageView', {
        url: "/imageView",
        templateUrl: "app/CTimage/imageView.html",
        controller: "imageViewCtrl",
        data: {pageTitle: 'imageView'},

        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([

              {
                files: ['plugins/underscore/underscore-min.js']
              },
              {
                files: ['plugins/jsTree/style.min.css', 'plugins/jsTree/jstree.min.js']
              },
              {
                name: 'ngJsTree',
                files: ['plugins/jsTree/ngJsTree.min.js']
              },
              {
                serie: true,
                files: ['plugins/c3/c3.min.css', 'plugins/d3/d3.min.js', 'plugins/c3/c3.min.js']
              },
              {
                serie: true,
                name: 'gridshore.c3js.chart',
                files: ['plugins/c3/c3-angular.min.js']
              },
              {
                files: ['plugins/chartJs/Chart.min.js']
              },
              {
                name: 'angles',
                files: ['plugins/chartJs/angles.js']
              }
            ]);
          }
        }
      })

      .state('index.CTdirector', {
        url: "/CTdirector",
        templateUrl: "app/CTimage/CTdirector.html",
        data: {pageTitle: 'Example view'},
        controller: "CTdirector",
        controllerAs: "chart",
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                serie: true,
                name: 'angular-flot',
                files: ['plugins/flot/jquery.flot.js', 'plugins/flot/jquery.flot.time.js', 'plugins/flot/jquery.flot.tooltip.min.js', 'plugins/flot/jquery.flot.spline.js', 'plugins/flot/jquery.flot.resize.js', 'plugins/flot/jquery.flot.pie.js', 'plugins/flot/curvedLines.js', 'plugins/flot/angular-flot.js',]
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-2.0.2.min.js', 'plugins/jvectormap/jquery-jvectormap-2.0.2.css']
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-world-mill-en.js']
              },
              {
                files: ['plugins/chartJs/Chart.min.js']
              },
              {
                name: 'angles',
                files: ['plugins/chartJs/angles.js']
              },
              {
                name: 'ui.checkbox',
                files: ['plugins/bootstrap/angular-bootstrap-checkbox.js']
              },
              {
                files: ['plugins/echarts/echarts.min.js']
              }

            ]);
          }
        }
      })

      .state('index.imageList', {
        url: "/imageList",
        templateUrl: "app/CTimage/imageList.html",
        controller: "imageListCtrl",
        data: {pageTitle: 'imageListCtrl'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              },
            ]);
          }
        }
      })

      .state('index.contouringList', {
        url: "/contouringList",
        templateUrl: "app/contouring02/contouringList.html",
        controller: "contourImageList",
        data: {pageTitle: 'contouringList'},

        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                serie: true,
                files: ['plugins/moment/moment.min.js']
              },
              {
                name: 'datePicker',
                files: ['plugins/datapicker/angular-datapicker.css', 'plugins/datapicker/angular-datepicker.js']
              },
              {
                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              },
            ]);
          }
        }
      })

      .state('index.makingModel', {
        url: "/makingModel",
        templateUrl: "app/makingModel/makingModel.html",
        controller: "modelController",
        data: {pageTitle: 'makingModel'},

        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              },
              {
                files: ['plugins/sweetalert/sweetalert.min.js', 'plugins/sweetalert/sweetalert.css']
              },
              {
                name: 'oitozero.ngSweetAlert',
                files: ['plugins/sweetalert/angular-sweetalert.min.js']
              }
            ]);
          }
        }
      })

      .state('index.confirmModel', {
        url: "/confirmModel",
        templateUrl: "app/makingModel/confirmModel.html",
        controller: "confirmModel",
        data: {pageTitle: 'confirmModel'},

        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              },
              {
                files: ['plugins/sweetalert/sweetalert.min.js', 'plugins/sweetalert/sweetalert.css']
              },
              {
                name: 'oitozero.ngSweetAlert',
                files: ['plugins/sweetalert/angular-sweetalert.min.js']
              }
            ]);
          }
        }
      })

      .state('index.modelForm', {
        url: "/modelForm",
        templateUrl: "app/makingModel/modelForm.html",
        controller: "modelForm",
        data: {pageTitle: 'modelForm'},

        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['/app/validate/validate.css']
              },
              {
                insertBefore: '#loadBefore',
                name: "AngularPrint",
                files: ['bower_components/angularPrint/angularPrint.js', 'bower_components/angularPrint/angularPrint.css']
              }
            ]);
          }
        }
      })

      .state('index.modeling', {
        url: "/modeling",
        cache: false,
        templateUrl: "app/makingModel/modeling.html",
        controller: "modelingCtrl",
        data: {pageTitle: 'modeling'},

        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['/app/validate/validate.css']
              },
              {
                files: ['plugins/sweetalert/sweetalert.min.js', 'plugins/sweetalert/sweetalert.css']
              },
              {
                name: 'oitozero.ngSweetAlert',
                files: ['plugins/sweetalert/angular-sweetalert.min.js']
              },
            ]);
          }
        }
      })

      .state('index.validate', {
        url: "/validate",
        templateUrl: "app/validate/validate.html",
        controller: "validateCtrl",
        data: {pageTitle: 'validate view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['/app/validate/validate.css']
              },
              {
                insertBefore: '#loadBefore',
                name: "AngularPrint",
                files: ['bower_components/angularPrint/angularPrint.js', 'bower_components/angularPrint/angularPrint.css']
              }
            ]);
          }
        }
      })

      .state('index.checkoutForm', {
        url: "/checkoutForm",
        templateUrl: "app/validate/checkoutForm.html",

        data: {pageTitle: 'checkoutForm view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                insertBefore: '#loadBefore',
                name: "AngularPrint",
                files: ['bower_components/angularPrint/angularPrint.js', 'bower_components/angularPrint/angularPrint.css']
              },
              {
                serie: true,
                files: ['plugins/moment/moment.min.js']
              },
            ]);
          }
        }
      })


      .state('validate_print', {
        url: "/validate_print",
        templateUrl: "app/validate/validate_print.html",
        controller: "validatePrintCtrl",
        data: {pageTitle: 'validate view', specialClass: 'gray-bg'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['/app/validate/validate.css']
              }
            ]);
          }
        }
      })


      .state('index.charging', {
        url: "/charging",
        templateUrl: "app/charging/charging.html",
        controller: "chargingCtrl",
        data: {pageTitle: 'charging view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                insertBefore: '#loadBefore',
                name: 'toaster',
                files: ['plugins/toastr/toastr.min.css', 'plugins/toastr/toastr.min.js']
              }
            ]);
          }
        }
      })

      .state('index.payMoney', {
        url: "/payMoney",
        templateUrl: "app/charging/payMoney.html",
        controller: "payMoneyCtrl",
        data: {pageTitle: 'payMoney view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                insertBefore: '#loadBefore',
                name: 'toaster',
                files: ['plugins/toastr/toastr.min.css', 'plugins/toastr/toastr.min.js']
              },
              {
                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              }
            ]);
          }
        }
      })

      .state('index.payMoneyDetail', {
        url: "/payMoneyDetail",
        templateUrl: "app/charging/payMoneyDetail.html",
        controller: "payMoneyDetail",
        data: {
          pageTitle: 'payMoneyDetail view',
          navigation: {
            title: "缴费详情",
            path: [
              {
                txt: "缴费列表",
                sref: "index.payMoney"
              },
              {
                txt: "缴费详情",
                sref: "index.payMoneyDetail"
              }
            ]
          },

        },
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                insertBefore: '#loadBefore',
                name: 'toaster',
                files: ['plugins/toastr/toastr.min.css', 'plugins/toastr/toastr.min.js']
              },
              {
                name: 'ui.knob',
                files: ['plugins/jsKnob/jquery.knob.js', 'plugins/jsKnob/angular-knob.js']
              },
              {
                files: ['plugins/sweetalert/sweetalert.min.js', 'plugins/sweetalert/sweetalert.css']
              },
              {
                name: 'oitozero.ngSweetAlert',
                files: ['plugins/sweetalert/angular-sweetalert.min.js']
              }
            ]);
          }
        }
      })

      .state('index.treatment', {
        url: "/treatment",
        templateUrl: "app/treatment/treatment.html",
        controller: "treatmentCtrl",
        data: {pageTitle: 'treatment view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                insertBefore: '#loadBefore',
                name: 'toaster',
                files: ['plugins/toastr/toastr.min.css', 'plugins/toastr/toastr.min.js']
              },
              {
                files: ['plugins/sweetalert/sweetalert.min.js', 'plugins/sweetalert/sweetalert.css']
              },
              {
                name: 'oitozero.ngSweetAlert',
                files: ['plugins/sweetalert/angular-sweetalert.min.js']
              },
              {
                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              }
            ]);
          }
        }
      })


      .state('index.treatRecord', {
        url: "/treatRecord",
        templateUrl: "app/treatment/treatRecord.html",
        controller: "treatRecordCtrl",
        data: {pageTitle: 'treatRecord view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['/app/validate/validate.css']
              },
              {
                files: ['plugins/sweetalert/sweetalert.min.js', 'plugins/sweetalert/sweetalert.css']
              },
              {
                name: 'oitozero.ngSweetAlert',
                files: ['plugins/sweetalert/angular-sweetalert.min.js']
              },
              {
                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              }
            ]);
          }
        }
      })

      .state('index.radiotherapyRecord', {
        url: "/radiotherapyRecord",
        templateUrl: "app/record/radiotherapyRecord.html",
       /* controller: "radiotherapyRecordCtrl",*/
        data: {pageTitle: 'radiotherapyRecord view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css']
              },
              {
                files: ['/app/validate/validate.css']
              },
              {
                insertBefore: '#loadBefore',
                name: "AngularPrint",
                files: ['bower_components/angularPrint/angularPrint.js', 'bower_components/angularPrint/angularPrint.css']
              }
            ]);
          }
        }
      })

      .state('index.afterloading', {
        url: "/afterloading",
        templateUrl: "app/record/afterloadingRecord.html",
        /*controller:"afterloadingCtrl",*/
        data: { pageTitle: 'afterloadingRecord view' },
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css']
              },
              {
                files: ['/app/validate/validate.css']
              },
              {
                insertBefore: '#loadBefore',
                name:  "AngularPrint",
                files: ['bower_components/angularPrint/angularPrint.js','bower_components/angularPrint/angularPrint.css']
              }
            ]);
          }
        }
      })

      .state('index.timeline', {
        url: "/timeline",
        templateUrl: "app/timeline/timeline.html",
        controller: "timelineCtrl",
        data: {pageTitle: 'timeline view'},
      })

      .state('index.timelineList', {
        url: "/timelineList",
        templateUrl: "app/timeline/timelineList.html",
        controller: "timelineListCtrl",
        data: {pageTitle: 'timeline view'},
      })

      .state('index.doctorChat', {
        url: "/doctorChat",
        templateUrl: "app/timeline/doctorChat.html",
        data: {pageTitle: 'timeline view'},
      })

      .state('index.schedule', {
        url: "/schedule",
        //v1
        templateUrl: "app/record/schedule.html",
        /*v2*/
        // templateUrl: "app/record/schedule02.html",
        controller: "scheduleCtrl",
        data: {pageTitle: 'schedule view'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['bower_components/ngDraggable/ngDraggable.js']
              }
            ]);
          }
        }
      })

      .state('user', {
        abstract: true,
        url: "/user",
        templateUrl: "components/common/content.html"
      })

      .state('user.setting', {
        url: "/setting",
        templateUrl: "app/user/setting.html",
        controller: "settingCtrl",
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css']
              },

              {
                name: 'datePicker',
                files: ['plugins/datapicker/angular-datapicker.css', 'plugins/datapicker/angular-datepicker.js']
              },
              {
                serie: true,
                files: ['plugins/moment/moment.min.js']
              },
              {
                insertBefore: '#loadBefore',
                name: 'toaster',
                files: ['plugins/toastr/toastr.min.css', 'plugins/toastr/toastr.min.js']
              },
            ]);
          }
        }
      })

      .state('user.userList', {
        url: "/userList",
        templateUrl: "app/user/userList.html",
        controller: "settingCtrl",
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              },
              {
                files: ['plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css']
              },
              {
                insertBefore: '#loadBefore',
                name: 'toaster',
                files: ['plugins/toastr/toastr.min.css', 'plugins/toastr/toastr.min.js']
              },
            ]);
          }
        }
      })

      .state('user.nurseDirector', {
        url: "/nurseDirector",
        templateUrl: "app/user/nurseDirector.html",
        data: {pageTitle: 'Example view'},
        controller: "nurseDirector",
        controllerAs: "chart",
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                serie: true,
                name: 'angular-flot',
                files: ['plugins/flot/jquery.flot.js', 'plugins/flot/jquery.flot.time.js', 'plugins/flot/jquery.flot.tooltip.min.js', 'plugins/flot/jquery.flot.spline.js', 'plugins/flot/jquery.flot.resize.js', 'plugins/flot/jquery.flot.pie.js', 'plugins/flot/curvedLines.js', 'plugins/flot/angular-flot.js',]
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-2.0.2.min.js', 'plugins/jvectormap/jquery-jvectormap-2.0.2.css']
              },
              {
                files: ['plugins/jvectormap/jquery-jvectormap-world-mill-en.js']
              },
              {
                files: ['plugins/chartJs/Chart.min.js']
              },
              {
                name: 'angles',
                files: ['plugins/chartJs/angles.js']
              },
              {
                name: 'ui.checkbox',
                files: ['plugins/bootstrap/angular-bootstrap-checkbox.js']
              },
              {
                files: ['plugins/echarts/echarts.min.js']
              }

            ]);
          }
        }
      })


      .state('topnavbar', {
        url: "/topnavbar",
        templateUrl: "components/common/topnavbar.html",
        data: {pageTitle: 'topnavbar view'},
      })

      .state('index.homepage', {
        url: "/homepage",
        templateUrl: "app/doctor/doctorhome.html",
        controller: "doctorHomeCtrl",
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/footable/footable.core.css', 'plugins/footable/footable.all.min.js']
              },
              {
                name: 'ui.footable',
                files: ['plugins/footable/angular-footable.js']
              }
            ]);
          }
        }
      })

      //template(pin)
      .state('template', {
        abstract: true,
        url: "/template",
        templateUrl: "components/common/content.html"
      })

      .state('template.pin', {
        url: "/pin",
        templateUrl: "template/pin/pin_board.html",
        controller: "pinCtrl"
      })

      .state('template.calendar', {
        url: "/calendar",
        templateUrl: "template/calendar/calendar.html",
        controller: "CalendarCtrl",
        data: {pageTitle: 'Calendar'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                insertBefore: '#loadBefore',
                files: ['template/calendar/fullcalendar.css', 'template/calendar/fullcalendar.min.js', 'template/calendar/gcal.js']
              },
              {
                name: 'ui.calendar',
                files: ['template/calendar/calendar.js', 'template/calendar/jquery-ui-1.10.4.min.js']
              }
            ]);
          }
        }
      })

      .state('template.draggable', {
        url: "/draggable",
        templateUrl: "template/draggable/draggable.html",
        controller: "draggableCtrl",
        data: {pageTitle: 'draggable'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                name: 'ui.sortable',
                files: ['bower_components/angular-ui-sortable/sortable.min.js']
              }
            ]);
          }
        }
      })

      .state('template.echarts', {
        url: "/echarts",
        templateUrl: "template/echarts/echarts.html",
        // controller: "echartsCtrl",
        data: {pageTitle: 'echarts'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: ['plugins/echarts/echarts.min.js']
              }
            ]);
          }
        }
      })
      .state('template.scrollbar', {
        url: "/scrollbar",
        templateUrl: "template/scrollbar/scrollbar.html",
        // controller: "echartsCtrl",
        data: {pageTitle: 'scrollbar'},
        resolve: {
          loadPlugin: function ($ocLazyLoad) {
            return $ocLazyLoad.load([
              {
                files: [
                  'plugins/custom-scrollbar/jquery.mCustomScrollbar.min.css',
                  'bower_components/jquery/dist/jquery.js',
                  'plugins/custom-scrollbar/jquery.mCustomScrollbar.concat.min.js'
                ]
              }
            ]);
          }
        }
      })

    $urlRouterProvider.otherwise('/login');
  }).run(function ($rootScope, $state) {
  $rootScope.state = $state;
});

